src_components[name] = meta
for target in src_snapshot['targets']:
- del target['base']['ostree-revision']
+ for content_item in target['contents']:
+ name = content_item['name']
+ rev = bin_components[name]
+ content_item['ostree-revision'] = rev
return src_snapshot
'rev-parse', base_name])
base['ostree-revision'] = base_revision
+ if 'architecture-buildroots2' in bin_snapshot:
+ for arch,buildroot in bin_snapshot['architecture-buildroots2'].iteritems():
+ name = buildroot['name']
+ rev = run_sync_get_output(['ostree', '--repo=' + self.repo,
+ 'rev-parse', name])
+ buildroot['ostree-revision'] = rev
+
component_refs = []
for name in components.iterkeys():
for architecture in component_architectures[name]:
dependencies = buildutil.build_depends(component_name, components)
component = components.get(component_name)
- buildroots = self.snapshot['architecture-buildroots']
- base_devel_name = 'bases/' + buildroots[architecture]
+ ref_to_rev = {}
+
+ arch_buildroot_name = None
+ arch_buildroot_rev = None
+ if 'architecture-buildroots2' in self.snapshot:
+ buildroots = self.snapshot['architecture-buildroots2']
+ arch_buildroot = buildroots[architecture]
+ arch_buildroot_name = arch_buildroot['name']
+ arch_buildroot_rev = arch_buildroot.get('ostree-revision')
+ else:
+ buildroots = self.snapshot['architecture-buildroots']
+ arch_rev_suffix = buildsroots['architecture']
+ arch_buildroot_name = 'bases/' + arch_rev_suffix
- refs_to_resolve = [base_devel_name]
- checkout_trees = [(base_devel_name, '/')]
+ if arch_buildroot_rev is None:
+ arch_buildroot_rev = run_sync_get_output(['ostree', '--repo=' + self.repo, 'rev-parse',
+ arch_buildroot_name]).strip()
+
+ ref_to_rev[arch_buildroot_name] = arch_buildroot_rev
+ checkout_trees = [(arch_buildroot_name, '/')]
+ refs_to_resolve = []
for dependency_name in dependencies:
buildname = 'components/%s/%s' % (dependency_name, architecture)
refs_to_resolve.append(buildname)
checkout_trees.append((buildname, '/devel'))
resolved_refs = self._resolve_refs(refs_to_resolve)
- ref_to_rev = {}
for ref,rev in zip(refs_to_resolve, resolved_refs):
ref_to_rev[ref] = rev
snapshot['architecture-buildroots'] = {}
for architecture in manifest_architectures:
snapshot['architecture-buildroots'][architecture] = '%s-%s-devel' % (base_prefix, architecture)
+ # Lame bit neeeded because I didn't have enough foresight to use an object
+ # for this in the first place, and I don't want to break backwards compatibility
+ # right now.
+ snapshot['architecture-buildroots2'] = {}
+ for architecture in manifest_architectures:
+ snapshot['architecture-buildroots2'][architecture] = {'name': 'bases/%s-%s-devel' % (base_prefix, architecture)}
components_by_name = {}
component_ordering = []